package com.kukudexin.time.mayikt.stream;

import java.util.stream.LongStream;

/**
 * @author: 酷酷的鑫
 * @Date: 2022/1/12 14:48
 * @description:
 */
public class ForkJoinDurationTest {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        LongStream longStream = LongStream.rangeClosed(0, 50000000000L);
        long asLong = longStream.parallel().reduce(Long::sum).getAsLong();
        System.out.println(asLong);
        long end = System.currentTimeMillis();
        System.out.println("五百亿求和耗费的时间为: " + (end - start));
    }

}
